-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/periph/rtc: Add rtc mem survive reset test #20404
base: master
Are you sure you want to change the base?
Conversation
the commit will need rewording
|
06602ab
to
4737760
Compare
This commit rewrites the rtc test application to include tests for rtc memory persistence across reboots
4737760
to
24a1a95
Compare
Should all be a-ok now |
tests/periph/rtc/main.c
Outdated
|
||
_set_rtc_mem(); | ||
_get_rtc_mem(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions / static-tests
too many consecutive empty lines
seems like no rtc_mem-platform is in our CI-tests |
the samr34 exists on iot-lab and should have rtc_mem. Also the lrwan1 board, however that uses backup registers and so this board will fail the test. (see #11304) |
Co-authored-by: Karl Fessel <[email protected]>
Co-authored-by: Karl Fessel <[email protected]>
Contribution description
The
periph/rtc
test did not test if the rtc memory persisted across reboot. This PR aims to fix that.The test is reworked to utilize the
shell
module. This is needed since testing across reboots means we have to clear RTC memory first, then write and verify, then reboot and verify again. In addition the test still tests the rtc alarms.Additionally this also changes the test to use
ztimer
instead ofxtimer
Some parts of RIOT utilizes the backup registers in ways that will force a reset of the RTC and therefore of the registers. This test will fail on those since is clears and writes to all available registers. Ideas on how this should be handled is welcome!
Testing procedure
When running the test application execute the following commands and verify the output
rtc_clear
returnsRTC mem cleared
rtc_verify
returnsRTC mem content does not match
rtc_write
returnsRTC mem set
rtc_verify
returnsRTC mem OK
rtc_reboot
reboots devicertc_verify
returnsRTC mem OK
rtc_clear
returnsRTC mem cleared
. This is to clear RTC for the future.rtc_test_alarms
returnsThis procedure is also included in the
tests/01-run.py
somake test
on a board that supports theperiph_rtc_mem
feature will execute the above steps.Issues/PRs references